package com.niit.class_3.service.impl;

import com.niit.class_3.dao.IUserDAO;
import com.niit.class_3.dao.impl.UserDAOImpl;
import com.niit.class_3.domain.Users;
import com.niit.class_3.service.IUserService;

public class UserServiceImpl implements IUserService {

        private IUserDAO uao ;

	public UserServiceImpl() {
            uao = new UserDAOImpl() ;
        }


        public Users checkUser(String userName, String pwd){
            Users user = uao.queryUserByUserName(userName);
            if (user == null) {
                return null;
            }
            if (user.getUserPwd().equals(pwd)) {
                return user;
            }
            return null;
        }
    }

